<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>领用</title>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/themes/icon.css"/>">
<link rel="stylesheet" type="text/css" 
	href="<c:url value="/css/themes/yzr_style.css"/>">
<script type="text/javascript" src="<c:url value="/js/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/easyui-lang-zh_CN.js"/>"></script>
<style type="text/css">
</style>
</head>
<body class="easyui-layout">
<script src="<c:url value="/js/jquery-migrate-1.1.0.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/jquery.jqprint-0.3.js"/>"></script>
<script type="text/javascript">	
$(function(){
	//打开新建领用单的窗口
	$("#lmb—hl_add").linkbutton({onClick:function(){						
		$("#lmb_hl_win").window("open");
		$("#lmb_hl_plan").form("clear");
		$('#lmb-hclyDet-dg').datagrid('loadData', { total: 0, rows: [] }); 
	}});
	
	
	// 刷新
	$("#lmb—hl_reload").linkbutton({onClick:function(){
		$("#lmb-hl").datagrid({
    		url: 'to_queryLmbConsumableCollarByPage', 
    		method: 'get',
    		queryParams: {
    			page:1,
    			rows:15,    	
    		}});
	}});
	
	
	//选择领用对象
	$("#lmb-lingyong-btn-cz").linkbutton({onClick: function(){
		$("#lmb-lingyong-keshi-panel").window("open");
		$("#tb-lingyong_keshi-dg").datagrid({
    		url: 'to_lmb_queryAllDeptLmb_byPage',			    		
    		method: 'get',
    		queryParams: {
    			page:1,
    			rows:100
    	}});		
		
		/*
		var lmb_ly_type = $("#lmb-lingyong-type").combobox("getValue");
		if(lmb_ly_type == ''){
			$.messager.alert("提示", "请选择领用类型！");
		}else{
			if(lmb_ly_type == '科室'){
				//	<!-- lmb-lingyong-keshi-panel,tb-lingyong_keshi-dg -->
				$("#lmb-lingyong-keshi-panel").window("open");
				$("#tb-lingyong_keshi-dg").datagrid({
		    		url: 'to_lmb_queryAllDeptLmb_byPage',			    		
		    		method: 'get',
		    		queryParams: {
		    			page:1,
		    			rows:100
		    	}});
			}else if(lmb_ly_type == '员工'){
				//	<!-- lmb-lingyong-yuangong-panel, tb-lingyong_yuangong-dg-->
				$("#lmb-lingyong-yuangong-panel").window("open");
				$("#tb-lingyong_yuangong-dg").datagrid({
		    		url: 'queryAllStaff',
		    		method: 'get'
		    	});
			}			
		}
		*/		
	}});
		
	
	//显示全部科室
	$("#lmb-lingyong-keshi-reload").linkbutton({onClick:function(){
		$("#tb-lingyong_keshi-dg").datagrid({
    		url: 'to_lmb_queryAllDeptLmb_byPage', 
    		method: 'get'
    	});			
	}});
	
	//根据科室名称搜索科室
	$('#lmb-lingyong-keshi-search').searchbox({
	    searcher:function(value,name){
	    	if(value == ''){
	    		$.messager.alert("提示", "请输入查询条件！");
	    	}else{
	    		$("#tb-lingyong_keshi-dg").datagrid({	    		
		    		url: 'to_lmb_findAllDeptBydname',
		    		method: 'post', 
		    		queryParams: {
		    			page:1,
		    			rows:13,
		    			ksName: value
		    	}});
	    	}		    	
	    }
	}); 
	
	/*
		//显示全部员工
	$("#lmb-lingyong-yuangong-reload").linkbutton({onClick:function(){
		$("#tb-lingyong_yuangong-dg").datagrid({
    		url: 'queryAllStaff', 
    		method: 'get'
    	});			
	}});
	
	//搜索员工
	$('#lmb-lingyong-yuangong-search').searchbox({
	    searcher:function(value,name){
	    	if(value == 'to_lmb_hcly'){
	    		$.messager.alert("提示", "请输入查询条件！");
	    	}else{
	    		$("#tb-lingyong_yuangong-dg").datagrid({	    		
		    		url: 'to_lmb_findStaffByIf',
		    		method: 'get',
	    			queryParams: {
		    			page:1,
		    			rows:13,
		    			value: value   			    	
	    		}});
	    	}		    	
	    }
	});
	*/
	
	
	//耗材编号，药品名，批号，单位，库存数量，结存数量，盈亏数量 
	var lmb_ly_objectId =  undefined;//领用对象编号
	var lmb_ly_objectName = undefined;//领用对象名称
	$("#lmb-lingyong-keshi-btn-ok").linkbutton({onClick: function(){
		var rows = $("#tb-lingyong_keshi-dg").datagrid("getSelections");
		console.log(rows);
		//$("#lmb_hcpd_form").form("validate");
		//
		if(rows.length == 1){
			lmb_ly_objectId = rows[0].departmentNo;
			lmb_ly_objectName = rows[0].departmentName;
			
			$("#lmb-lingyong-objectId").textbox("setValue",lmb_ly_objectId);
			$("#lmb-lingyong-object").textbox("setValue",lmb_ly_objectName);
			$("#lmb-lingyong-keshi-panel").window("close");
							
			lmb_ly_objectId = undefined;
			lmb_ly_objectName = undefined;
		}else{
			$.messager.alert("提示", "您还没有选择记录！");
		}
	}});
	
	
	/*
		$("#lmb-lingyong-yuangong-btn-ok").linkbutton({onClick: function(){
		var rows = $("#tb-lingyong_yuangong-dg").datagrid("getSelections");
		console.log(rows);
		//$("#lmb_hcpd_form").form("validate");
		if(rows.length == 1){
			lmb_ly_objectId = rows[0].staffNo;
			lmb_ly_objectName = rows[0].staffName;
			
			$("#lmb-lingyong-objectId").textbox("setValue",lmb_ly_objectId);
			$("#lmb-lingyong-object").textbox("setValue",lmb_ly_objectName);
			$("#lmb-lingyong-yuangong-panel").window("close");
							
			lmb_ly_objectId = undefined;
			lmb_ly_objectName = undefined;
		}else{
			$.messager.alert("提示", "您还没有选择记录！");
		}
	}});
	*/
	
	//根据仓库选择领用耗材
	//lmb-lingyong-panel，tb-lingyong_dg
	$("#lmb-lingyong-btn-hc-cz").linkbutton({onClick: function(){
		
		var lmb_ck = $("#lmb-lingyong-store").combogrid("getValue");
		if(lmb_ck== ''){
			$.messager.alert("提示", "请选择领用仓库！");
		}else{
			$("#lmb-lingyong-panel").window("open");
			$("#tb-lingyong_dg").datagrid({
	    		url: 'to_HcByCkId', 		    		
	    		method: 'get',
	    		queryParams: {
	    			ckId: lmb_ck
	    		}
	    	});				
		}		
	}});
    		
	$("#lmb-lingyong-btn-ok").linkbutton({onClick: function(){
		var rows = $("#tb-lingyong_dg").datagrid("getSelections");
		console.log(rows);
		$("#lmb_hl_plan").form("validate");
		if(rows.length == 1){
			 lmb_cid = rows[0].cstocCid;
			 lmb_cName = rows[0].cstocCname;
			 lmb_BatchNum = rows[0].cstocBatchNum;
			 lmb_norms = rows[0].cstocNorms;
			 lmb_Num = rows[0].cstocNum;
			 
			 $("#lmb-lingyong-cname").textbox("setValue",lmb_cName);
			 $("#lmb-lingyong-pihao").textbox("setValue",lmb_BatchNum);
			 $("#lmb-lingyong-kcnumber").textbox("setValue",lmb_Num);
			 $("#lmb-lingyong-haocaiId").textbox("setValue",lmb_cid);
			 $("#lmb-lingyong-haocaiNorms").textbox("setValue",lmb_norms);
			 $("#lmb-lingyong-panel").window("close");
			 			
			lmb_cName = undefined;
			lmb_BatchNum = undefined;
			lmb_Num = undefined;
			
			lmb_cid = undefined;
			lmb_norms = undefined;	 
		
		}else{
			$.messager.alert("提示", "您还没有选择记录！");
		}
	}});
		
	//添加数据到datagrid
	$("#lmb-lingyongDet-add").linkbutton({onClick: function(){
		//alert(33333333);
		//验证表单是否完善
		if($('#lmb_hl_plan').form("validate")){
			//库存数量
			var lmb_num = $("#lmb-lingyong-kcnumber").textbox("getValue");		
			//领用数量
			var lmb_lingyong_num = $("#lmb-lingyong-shuliang").numberbox("getValue");
			//alert("领用数量"+lmb_lingyong_num);
			if(eval(lmb_lingyong_num) < eval(lmb_num)){				
				//添加行
				$('#lmb-hclyDet-dg').datagrid('appendRow',{
					cdCId:$("#lmb-lingyong-haocaiId").textbox("getValue"),
					cdCName:$("#lmb-lingyong-cname").textbox("getValue"),
					cdBatchNum:$("#lmb-lingyong-pihao").textbox("getValue"),
					cdNorms:$("#lmb-lingyong-haocaiNorms").textbox("getValue"),
					cdNum:$("#lmb-lingyong-shuliang").numberbox("getValue"),
				});				
			}else{
				//alert("领用数量大于库存数量");
				$("#lmb-lingyong-shuliang").numberbox("setValue",lmb_num);
				$('#lmb-hclyDet-dg').datagrid('appendRow',{
					cdCId:$("#lmb-lingyong-haocaiId").textbox("getValue"),
					cdCName:$("#lmb-lingyong-cname").textbox("getValue"),
					cdBatchNum:$("#lmb-lingyong-pihao").textbox("getValue"),
					cdNorms:$("#lmb-lingyong-haocaiNorms").textbox("getValue"),
					cdNum:$("#lmb-lingyong-shuliang").numberbox("getValue"),
				});	
			}	
			
			//清除部分数据
			$("#lmb-lingyong-cname").textbox("clear");
			$("#lmb-lingyong-pihao").textbox("clear");
			$("#lmb-lingyong-kcnumber").textbox("clear");
			$("#lmb-lingyong-haocaiId").textbox("clear");
			$("#lmb-lingyong-haocaiNorms").textbox("clear");			
			$("#lmb-lingyong-shuliang").numberbox("clear");
		}else{
			alert("请完善所有数据！");
		}		
	}});
		
	//删除行
	$("#lmb-lingyong-btn—cancel").linkbutton({onClick: function(){
		var rows = $("#tb-lingyong_dg").datagrid("getSelections");			
		var lmb_ly_index =$('#tb-lingyong_dg').datagrid('getRowIndex', rows[0]);
		$('#tb-lingyong_dg').datagrid('deleteRow',lmb_ly_index);
	}});
	
	//提交领用单
	$("#lmb-lingyongDet-tijiao").linkbutton({onClick: function(){
		
		var rows = $("#lmb-hclyDet-dg").datagrid("getRows");
		console.log(JSON.stringify(rows));

		//药品编号，药品名称，批号，单位，库存数量，结存数量，盈亏数量
		for(var i = 0; i < rows.length; i ++){
			generateHiddenLmb_lingyong(rows[i], "cdCId", i);
			generateHiddenLmb_lingyong(rows[i], "cdCName", i);
			generateHiddenLmb_lingyong(rows[i], "cdBatchNum", i);
			generateHiddenLmb_lingyong(rows[i], "cdNorms", i);
			generateHiddenLmb_lingyong(rows[i], "cdNum", i);
		}
		
		//
		$('#lmb_hl_plan').form('submit', {			
			url: 'to_lmb_hcly', 
			onSubmit: function(){
		    	return $('#lmb_hl_plan').form("validate");
		    }, 
			success: function(v){
				$.messager.alert('提示', "提交成功");
				$(":hidden[x='y']").remove();			
				$('#lmb_hl_plan').form("clear");
				$('#lmb-hclyDet-dg').datagrid('loadData', { total: 0, rows: [] }); 
				$("#lmb_hl_win").window("close");
				$("#lmb-hl").datagrid("reload");
			}
		});
	}});

	//创建隐式表单域来保存明细
	function generateHiddenLmb_lingyong(row, name, i){
		var lmb_hl_plan = $('#lmb_hl_plan');
		//type='hidden'
		$("<input type='hidden' x='y'>")
			.attr("name", "collarDetail[" + i + ']' + '.' + name)
			.val(row[name])
			.appendTo(lmb_hl_plan);
	}	
	
	//日期转换
	function lmb_todate_ly(value){
        if(value){
			var date = new Date(value);  
            return date.toLocaleDateString();
		}
    }
	
	$("#lmb—hl_xq").linkbutton({onClick: function(){
		var rows = $("#lmb-hl").datagrid("getSelections");
		if(rows.length == 1){	  				
			$('#lmb-hclyDet-window').window("open");	
			var collarId = rows[0].collarId;
			alert(collarId);
			$.getJSON("toLmbqueryCollar", {"collarId": collarId}, function(data){
				$("#lmb-hclyDet-lybh").linkbutton({text: data.collarId});
				$("#lmb-hclyDet-lyrq").linkbutton({text: lmb_todate_ly(data.collarDate)});
				$("#lmb-hclyDet-lydx").linkbutton({text: data.collarObjectName});
				$("#lmb-hclyDet-lyck").linkbutton({text: data.collarStorehouseName});
				$("#lmb-hclyDet-spr").linkbutton({text: data.collarApprovepeopleName});
				$("#lmb-hclyDet-spsj").linkbutton({text:lmb_todate_ly(data.collarApprovedate)});
				$("#lmb-hclyDet-spzt").linkbutton({text: data.collarState});
				$("#lmb-hclyDet-lyzt").linkbutton({text: data.collarCkstatus});
			});	
			
			 //根据id查看详情	
			$("#lmb-hclyDet").datagrid({
				url:'toLmbqueryLyByLyId',
				method:'post',
				queryParams:{
					collarId:collarId
				}
			
			});
			 
		}else{
			$.messager.alert("提示", "只能选择一条记录，您目前选择了" + rows.length + "条!");
		}
	}});
	//<!-- lmb-hclyDet-print,lmb-hclyDet-window -->
	//点击按钮打印
	$("#lmb-hclyDet-print").linkbutton({
		onClick: function(){
			$("#lmb-hclyDet-printArea").jqprint();								
		}			
	});
});

		
</script> 
		<table id="lmb-hl" class="easyui-datagrid" data-options="
			url:'to_queryLmbConsumableCollarByPage',
			fitColumns:true,fit:true,
			pagination: true,
			pageSize: 5,
			pageList: [5, 10, 15, 20],
			rownumbers: true,
			toolbar: '#lmb—hl',
			border:false
			">
		<thead>
			<tr>
				<th data-options="field:'',width:'5%',checkbox:true"></th>
				<th data-options="field:'collarId',width:'15%'">领用单编号</th>
				<th data-options="field:'collarObjectName',width:'12%'">领用对象</th>
				<th data-options="field:'collarDate', width:'12%',
						formatter:function(value){
                          var date = new Date(value);  
                          return date.toLocaleDateString();  
                 }">领用日期</th>
                <th data-options="field:'collarStorehouseName', width:'12%'">仓库</th>
				<th data-options="field:'collarState',width:'12%'">审批状态</th>
				<th data-options="field:'collarApproveresult',width:'10%'">审批结果</th>						
				<th data-options="field:'collarCkstatus',width:'10%'">出库状态</th>
				<th data-options="field:'collarBeizhu',width:'15%'">备注</th>
			</tr>
		</thead>
	</table>	
	<div id="lmb—hl">
		<a id="lmb—hl_add" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新建领用单</a>
		<a id="lmb—hl_xq" class="easyui-linkbutton" data-options="iconCls:'icon-xiangqing',plain:true">领用单详情</a>
		<a id="lmb—hl_reload" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
		<input id="lmb_hl-search" class="easyui-searchbox" data-options="menu: '#lmb_yl_mm', width: 250, prompt: '请输入你要查找的内容'"/>
	</div> 	
	<div id="lmb_yl_mm" style="width:150px">
		<div data-options="name:'22'">领用状态</div>
		<div data-options="name:'33'">领用单</div>
	</div>
	<div id="lmb_hl_win" class="easyui-window" title="领用单详情" data-options="collapsible:false,minimizable:false,maximizable:false,modal:true,iconCls:'icon-save',closed: true" style="width:900px;height:360px;padding:5px;">
		<div style="display:none;">
			<input id="lmb-lingyong-haocaiId" 	 class="easyui-textbox" data-options="labelAlign:'right',label:'药品编号'"/>			
			<input id="lmb-lingyong-haocaiNorms" class="easyui-textbox" data-options="labelAlign:'right',label:'单位'"/>
		</div>
		<form id="lmb_hl_plan" action="" method="post">
			<table width="100%" style="background: rgb(236,243,255); padding: 10px; border-radius: 5px;">							
				<tr>
					<!-- <td width="50%">
						<select id="lmb-lingyong-type" name="collar.collarType" class="easyui-combobox" data-options="label: '领用类型',width:'60%',panelHeight: 'auto',required:true">
           					<option value="科室">科室</option>
           					<option value="员工">员工</option>
      					</select>						
					</td> -->	
					
						
					<td>
						<input id="lmb-outstock-ckrq"class="easyui-datebox" name="collar.collarDate"
						data-options="label:'领用日期',width:'60%',required:true">
					</td>
					<!-- style="display:none;" -->
					<td style="display:none;" >
						<input id="lmb-lingyong-objectId" 	 name="collar.collarObject" class="easyui-textbox" data-options="label:'领用对象编号'"/>
					</td>			
					<td>
						<input id="lmb-lingyong-object"  name="" class="easyui-textbox"data-options="label:'领用对象',width:'60%',required:true">
						<a id="lmb-lingyong-btn-cz" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查找</a>				
					</td>	
					
				</tr>
				<tr>
					<td width="50%">
							<select id="lmb-lingyong-people" name="collar.collarApprovepeople" class="easyui-combogrid"
					data-options="
							width:'60%',
							label: '审批人',
							required:true,
							panelWidth: '290',
							panelHeight: 'auto',
							url: 'queryAllStaff',
							pagination: true,
							pageSize: 8,
							pageList: [8, 16, 24, 32],
							idField: 'staffNo',
							textField: 'staffName',
							columns: [[
								{field:'staffName',title:'姓名',width:100},
								{field:'departmentName',title:'部门',width:100},
								{field:'postName',title:'职务',width:85}
							]]
					"></select>
					</td>
					<td width="50%">
						<select id="lmb-lingyong-store"  name="collar.collarStorehouse" class="easyui-combogrid"
					data-options="
						width:'60%',
						label: '领用仓库',				
						required:true,
						panelWidth: '290',
						panelHeight: 'auto',				
						url: 'queryAllStorehouse',
						pagination: true,
						pageSize: 8,
						pageList: [8, 16, 24, 32],
						idField: 'storeId',
						textField: 'storeName',
						columns: [[
							{field:'storeName',title:'仓库名',width:100},
							{field:'storeKind',title:'类型',width:80},
							{field:'storeAddress',title:'地址 ',width:100}
						]]
					"></select>
					</td>
								
				</tr>
				<tr>
					<td width="50%">
						<input id="lmb-lingyong-cname" class="easyui-textbox"data-options="label:'领用耗材',width:'60%'">
						<a id="lmb-lingyong-btn-hc-cz" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查找</a>				
					</td>
					<td width="50%">
						<input  id="lmb-lingyong-pihao" class="easyui-textbox"  data-options="width:'60%',label:'批号',readonly:'readonly'">				
					</td>
					
				</tr>
				<tr>
					<td width="50%">
						<input id="lmb-lingyong-kcnumber" class="easyui-textbox"  data-options="width:'60%',label:'库存数量',readonly:'readonly'">					
					</td>
					<td width="50%">
						<input id="lmb-lingyong-shuliang" class="easyui-numberbox"  data-options="width:'60%',label:'领用数量',min:0">	
						<a id="lmb-lingyongDet-add" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a>
						<a id="lmb-lingyong-btn—cancel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">删除</a>
					</td>
					
				</tr>
			</table>
			<div style="margin: 5px;">
				<div id="lmb_hl_tabs" class="easyui-tabs" style="width:100%;margin-top:10px;"
					data-options="plain:true,narrow:true">
					<div id="lmb-hl-tab" title="耗材领用" style="padding:10px;" >		
						<table id="lmb-hclyDet-dg" class="easyui-datagrid" 
							data-options="
								iconCls: 'icon-edit',									
								width: '100%',
								toolbar: '#lmb_hcly_tb1',
								pagination: true,						
								pageSize: 8,
								pageList: [8, 16, 24, 32],
								">
							<thead>
								<tr>
									<th data-options="field:'cdCId',width:'25%',align:'center'">耗材编号</th>			
									<th data-options="field:'cdCName',width:'25%',align:'center'">耗材名称</th>
									<th data-options="field:'cdBatchNum',width:'17%',align:'center'">批号</th>
									<th data-options="field:'cdNorms',width:'16%',align:'center'">单位</th>
									<th data-options="field:'cdNum',width:'16%',align:'center'">领用数量</th>
								</tr>
							</thead>
					 </table>
					 <div id="lmb_hcly_tb1" style="height:auto">
							<a id="lmb-lingyongDet-tijiao" href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-ok'">提交</a>
					</div>				
					</div>				
				</div>								
			</div>
		</form>
	</div>
	
	<!-- 选择领用耗材窗口 -->
	<div id="lmb-lingyong-panel" class="easyui-window" title="选择领用耗材" style="width:850px;height:350px;" data-options="closable:true,closed:true,collapsible:false,minimizable:false,maximizable:false">
		<table id="tb-lingyong_dg" class="easyui-datagrid" 
			data-options="			
				fit:true,
				pagination: true,
				pageSize: 8,
				pageList: [8, 16, 24, 32],
				rownumbers: false,
				toolbar: '#lmb-toolbar-lingyong',
				border:false,
				singleSelect:true
			">
			<thead>
				<tr>								
					<th data-options="field:'cstocCid',width:'20%',align:'center',editor:'textbox'">耗材编号</th>				
					<th data-options="field:'cstocCname',width:'20%',align:'center',editor:'textbox'">耗材名称</th>
					<th data-options="field:'cstocBatchNum',width:'13%',align:'center',editor:'textbox'">批号</th>					
					<th data-options="field:'cstocNorms',width:'13%',align:'center',editor:'textbox'">单位</th>	
					<th data-options="field:'cstocNum',width:'13%',align:'center',editor:'textbox'">数量</th>																								
				</tr>
			</thead>
		</table>				    
	    
	    <!-- 工具栏 -->
	    <div id="lmb-toolbar-lingyong">
	    	<input id="lmb-lingyong-search" class="easyui-searchbox" data-options="menu: '#lmb-lingyong—serch-mm', width: 250, prompt: '请输入关键字'"/>    	
	    	<a id="lmb-lingyong-reload" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
	    	<a id="lmb-lingyong-btn-ok" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">确定</a>
	    </div>
	    	    
	    <!-- 搜索框 -->
	    <div id="lmb-lingyong—serch-mm" style="width:120px">
	    	<div data-options="name:'cName'">耗材名称</div>
		</div>		
	</div>		
	

	<!-- 选择科室窗口 -->
	<div id="lmb-lingyong-keshi-panel" class="easyui-window" title="选择科室" style="width:500px;height:350px;" data-options="closable:true,closed:true,collapsible:false,minimizable:false,maximizable:false">
		<table id="tb-lingyong_keshi-dg" class="easyui-datagrid" 
			data-options="			
				fit:true,
				pagination: true,
				pageSize: 8,
				pageList: [8, 16, 24, 32],
				rownumbers: false,
				toolbar: '#lmb-toolbar-lingyong-keshi',
				border:false,
				singleSelect:true
			">
			<thead>
				<tr>					
					<th data-options="field:'departmentNo',width:'33%',align:'center'">科室编号</th>				
					<th data-options="field:'departmentName',width:'33%',align:'center'">科室名称</th>	
					<th data-options="field:'address',width:'33%',align:'center'">科室地址</th>							
				</tr>
			</thead>
		</table>				    
	    
	    <!-- 工具栏 -->
	    <div id="lmb-toolbar-lingyong-keshi">
	    	<input id="lmb-lingyong-keshi-search" class="easyui-searchbox" data-options="menu: '#lmb-lingyong—serch-keshi-mm', width: 250, prompt: '请输入关键字'"/>    	
	    	<a id="lmb-lingyong-keshi-reload" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
	    	<a id="lmb-lingyong-keshi-btn-ok" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">确定</a>
	    </div>
	    	    
	    <!-- 搜索框 -->
	    <div id="lmb-lingyong—serch-keshi-mm" style="width:120px">
	    	<div data-options="name:'ksId'">科室名称</div>
		</div>		
	</div>	
	

	<!--
	<div id="lmb-lingyong-yuangong-panel" class="easyui-window" title="选择员工" style="width:600px;height:350px;" data-options="closable:true,closed:true,collapsible:false,minimizable:false,maximizable:false">
		<table id="tb-lingyong_yuangong-dg" class="easyui-datagrid" 
			data-options="			
				fit:true,
				pagination: true,
				pageSize: 8,
				pageList: [8, 16, 24, 32],
				rownumbers: false,
				toolbar: '#lmb-toolbar-lingyong-yuangong',
				border:false,
				singleSelect:true
			">
			<thead>
				<tr>	
					<th data-options="field:'staffNo',width:'21%',align:'center',editor:'textbox'">员工编号</th>	
					<th data-options="field:'staffName',width:'26%',align:'center',editor:'textbox'">员工姓名</th>				
					<th data-options="field:'departmentName',width:'24%',align:'center',editor:'textbox'">部门</th>	
					<th data-options="field:'postName',width:'22%',align:'center',editor:'textbox'">职位</th>								
				</tr>
			</thead>
		</table>
		
	    <div id="lmb-toolbar-lingyong-yuangong">
	    	<input id="lmb-lingyong-yuangong-search" class="easyui-searchbox" data-options="menu: '#lmb-lingyong—serch-yuangong-mm', width: 250, prompt: '请输入关键字'"/>    	
	    	<a id="lmb-lingyong-yuangong-reload" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
	    	<a id="lmb-lingyong-yuangong-btn-ok" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">确定</a>
	    </div>
	    	   
	    <div id="lmb-lingyong—serch-yuangong-mm" style="width:120px">
	    	<div data-options="name:'Name'">员工姓名</div>
		</div>	
	</div> 
	 -->
	<!--查看详情窗口-打印 -->
	<div id="lmb-hclyDet-window" class="easyui-window" title="领用计划详情" data-options="collapsible:false,minimizable:false,maximizable:false,modal:true,iconCls:'icon-save',closed: true" style="width:70%;height:70%;">		
		<div class="easyui-layout" style="padding:0px;" data-options="fit:true">			
			<div id="lmb-hclyDet-printArea" data-options="region:'center'" style="padding:5px;border-top:none;border-left:none;border-right:none;">			
				<form id="lmb_hclyDet_form" method="post">
					<h1 style="text-align: center">耗材领用详情</h1>
					<table width="100%">
					
						<tr>
							<td>领用编号: <a id="lmb-hclyDet-lybh" name="cpPlanId"     class="easyui-linkbutton" data-options="plain:true,"></a></td>
							<td>领用日期: <a id="lmb-hclyDet-lyrq" name="cpPlanTitle"  class="easyui-linkbutton" data-options="plain:true"></a></td>
							<td>领用对象:  <a id="lmb-hclyDet-lydx"  name="mname"        class="easyui-linkbutton" data-options="plain:true"></a></td>
							<td>领用仓库: <a id="lmb-hclyDet-lyck" name="cpPlanDate"   class="easyui-linkbutton" data-options="plain:true"></a></td>
						</tr>
						<tr>
							<td>审批人:<a id="lmb-hclyDet-spr"   name="pname" class="easyui-linkbutton" data-options="plain:true"></a></td>
							<td>审批时间:<a id="lmb-hclyDet-spsj" name="cpPlanApprovedate" class="easyui-linkbutton" data-options="plain:true"></a></td>
							<td>审批状态:<a id="lmb-hclyDet-spzt" name="cpPlanApprovedate" class="easyui-linkbutton" data-options="plain:true"></a></td>
							<td>领用状态:<a id="lmb-hclyDet-lyzt" name="cpPlanApprovedate" class="easyui-linkbutton" data-options="plain:true"></a></td>
						</tr>
					</table>
						
					<div style="margin: 5px;">
						<table id="lmb-hclyDet" class="easyui-datagrid" 
							data-options="
								iconCls: 'icon-edit',
								singleSelect: true,										
								width: '100%'						
						">			
							<thead>
								<tr>	
									<th data-options="field:'cdCId',width:'25%',align:'center'">耗材编号</th>			
									<th data-options="field:'cdCName',width:'25%',align:'center'">耗材名称</th>
									<th data-options="field:'cdBatchNum',width:'17%',align:'center'">批号</th>
									<th data-options="field:'cdNorms',width:'16%',align:'center'">单位</th>
									<th data-options="field:'cdNum',width:'16%',align:'center'">领用数量</th>
								</tr>
							</thead>
						</table>									
					</div>
				</form>				
			</div>
				
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
				<a id="lmb-hclyDet-print"  class="easyui-linkbutton" data-options="iconCls:'icon-print', plain:true">打印</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel', plain:true" href="javascript:$('#lmb-hclyDet-window').window('close');">取消</a>
			</div>			
		</div>
	</div>
</body>
</html>